// JavaScript Document
//float tip
var tooltips=function(){
	var width='200';
	var height='200';
	var nTop=0;
	var nLeft=0;
	function createiframe(w,h){
		var tipIFRM=document.createElement('iframe');
		tipIFRM.id='__tipIFRM';
		tipIFRM.setAttribute('frameBorder','0');
		if(!+"\v1"){
			tipIFRM.style.setAttribute('cssText','position:absolute;width:'+w+';height:'+h+';filter:alpha(opacity=0);z-index:99999;display:none;');
		}else{
			tipIFRM.setAttribute('style','position:absolute;width:'+w+';height:'+h+';filter:alpha(opacity=0);z-index:99999;display:none;')
		}
		document.body.appendChild(tipIFRM);
	}
	function creatediv(w,h){
		//var oFrag   = document.createDocumentFragment(); 
		var html=[]; 
		var tipDIV=document.createElement('div');
		tipDIV.id='__tipDIV';
		var csstxt='position:absolute;width:'+w+';height:'+h+';filter:alpha(opacity=100);opacity:1;z-index:999999;display:none;BACKGROUND-COLOR:#ffffff;';
		if(!+"\v1"){
			tipDIV.style.setAttribute('cssText',csstxt);
		}else{
			tipDIV.setAttribute('style',csstxt);
		}
		html.push('<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:#666666 1px solid" id="__tipBody">');
		html.push('<tr height="20"><td style="FONT-SIZE:10px; PADDING:2px; FONT-WEIGHT:bold; COLOR:#000000; BACKGROUND-COLOR:#ddddc5;border-bottom:#666666 1px solid" id="__tipTitle"></td></tr>');
		html.push('<tr><td style="FONT-SIZE:10px; PADDING:3px; COLOR:#333333; word-wrap:break-word" valign="top" id="__tipContent" style="border-top:#666666 1px solid"></td></tr>');
		html.push('</table>');
		//oFrag.appendChild(tipDIV);
		tipDIV.innerHTML=html.join('');
		document.body.appendChild(tipDIV);
	}
	function createtip(ow,oh){
		var tipIFRM=Fjs.getId('__tipIFRM');
		var tipDiv=Fjs.getId('__tipDIV');
		if(!tipIFRM){
			createiframe(ow,oh);
		}
		if(!tipDiv){
			creatediv(ow,oh);
		}
	}
	function showtip(obj,title,content,ow,oh){
		var w=(ow||width)+'px';
		var h=(oh||height)+'px';
		var ifrm;
		var sdiv;
		createtip(w,h);
		ifrm=Fjs.getId('__tipIFRM');
		sdiv=Fjs.getId('__tipDIV');
		sdiv.style.visibility='hidden';
		Fjs.getId('__tipTitle').innerHTML=title;
		Fjs.getId('__tipContent').innerHTML=content;
		ifrm.style.display='';
		sdiv.style.display='';
		ifrm.style.height=Fjs.getId('__tipBody').offsetHeight+'px';
		sdiv.style.height=Fjs.getId('__tipBody').offsetHeight+'px';
		obj.onmousemove=function(evt){
			var evt=evt||window.event;
			var px=evt.clientX;
			var py=evt.clientY;
			nTop=(Fjs.mousePosition(evt).y-10);
			nLeft=(Fjs.mousePosition(evt).x+10);
			if(py+parseInt(sdiv.style.height,10)>document.documentElement.clientHeight){
				if(parseInt(sdiv.style.height,10)>document.documentElement.clientHeight){
					nTop=nTop-py+10
				}else{
					nTop=nTop-(py+parseInt(sdiv.style.height,10)-document.documentElement.clientHeight)
				}
			}
			if(px+parseInt(w,10)>document.documentElement.clientWidth){
				if(px-this.offsetWidth>parseInt(w,10)+10){
					nLeft=nLeft-(this.offsetWidth+parseInt(w,10)+10)
				}
			}
			nTop=nTop+'px';
			nLeft=nLeft+'px';
			ifrm.style.top=nTop;
			ifrm.style.left=nLeft;
			sdiv.style.top=nTop;
			sdiv.style.left=nLeft;
			sdiv.style.visibility='visible';
		}
		obj.onmouseout=function(){
			closetip();
		}
	}
	function closetip(){
		Fjs.getId('__tipIFRM').style.display='none';
		Fjs.getId('__tipDIV').style.display='none';
		Fjs.getId('__tipTitle').innerHTML='';
		Fjs.getId('__tipContent').innerHTML='';
	}
	return {
		show:showtip
	}
}();